angular.module('mychat2').directive('autoScrollToBottom',function(){
	return{
		link:function(scope,element,attrs){
			console.log('ok');
			scope.$watch(function(){
				return element.children().length;
			},
			function(){
				element.animate({
					scrollTop:element.prop('scrollHeight')
				},1000);
			});
		}
	}
});